<!DOCTYPE html>
<HTML>
<HEAD><meta name="viewport" content="width=device-width, initial-scale=1">
<Title>BarLayer.setBarGap</Title>
<link type='text/css' rel='Stylesheet' href="maxchartapi.css" />
</HEAD>
<body bgcolor="#FFFFFF" text="#000000" topmargin="0" leftmargin="0" rightmargin="0" marginwidth="0" marginheight="0">

<p class="heading0">ChartDirector 7.0 (Java Edition)</p>
<p class="heading1"><a href="BarLayer.htm">BarLayer</a>.<wbr>setBarGap</p>
<hr class="separator">
<p class="heading2a">Usage</p>
<div class="content">
public void setBarGap(double barGap [, double subBarGap ])
</div>
<p class="heading2">Description</p>
<div class="content">
Sets the gap between the bars in a bar chart layer.<br><br>
In the setBarGap method, the gap between the bars is expressed as the portion of the space between the bars. For example, a bar gap of 0.2 means 20% of the distance between two adjacent bars is the gap between the bars.<br><br>
A bar gap of 0 means there is no gap in between the bars. The bar gap can be negative. In this case, the bars will overlap. The predefined constant <a href="Chart.TouchBar.htm">TouchBar</a> ( = -1.7E-100) means the bars will "touch", that is, the bar borders overlap, so two adjacent bars will share the same border.<br><br>
For multi-bar layers (bar layers using the <a href="Chart.Side.htm">Side</a> data combine method, or for stacked bar layers with multiple data groups), <b>barGap</b> refers to the portion of the space between bar groups, while <b>subBarGap</b> refers to the portion of the space between bars within the bar group.
</div>
<p class="heading2">Arguments</p>
<div class="content">
<div style="width:100%;box-sizing:border-box;">
<table border="1" cellpadding="5" cellspacing="0" width="100%"> 
<tr>
<th width="19%">Argument</th><th width="19%">Default</th><th>Description</th>
</tr>
<tr>
<td>barGap</td><td>(Mandatory)</td><td>The portion of the space between the bars (or between bar groups for multi-bar layers).</td></tr><tr><td>subBarGap</td><td>0.2</td><td>This argument only applies to multi-bar charts. It is the portion of the space between the bars in a bar group.</td>
</tr>
</table>
</div>
</div>
<p class="heading2">Return Value</p>
<div class="content">
None
</div>
<br><hr class="separator">
<div class="copyright">&copy; 2022 Advanced Software Engineering Limited. All rights reserved.</div>
</body>
</HTML>
